Create Note
What does it do?
Adds an internal note to the current chat. The note is attached to a message of the chat: the one you pass in messageId, or else the chat's latest message. The created note is stored under this node's name.
See the Overview for the note fields.
1. Syntax
<node_name>:
type: func
func_type: chat
func_id: createNote
params:
text: "<note_text>"
messageId: "<message_id>"
customName: "<author_name>"
on_complete: <next_node>
on_failure: <failure_node>
required params
typetype of the nodefunc_typehere it will be a chat functionfunc_idwhat function are we calling (createNote)params.textthe note text, 1 to 4096 characterson_completenext node after the note is created
optional params
params.messageIdID of a message in this chat to attach the note to. Defaults to the chat's latest message. A message from another chat fails the nodeparams.customNamename shown as the note's author instead of the default bot name. Up to 50 characters, must contain a visible characteron_failurenode for invalid params or amessageIdthat is not in this chatdepartmentassigns the chat to a departmentagentassigns the chat to a specific agent (email address or CRM ID as defined in the Texter agents manager)
2. Output
The created note is stored at %state:node.<node_name>%:
%state:node.<name>._id%the new note ID, for a latereditNoteordeleteNote%state:node.<name>.text%the saved text
3. Examples
Leave a summary for the agent before handoff
save_summary:
type: func
func_type: chat
func_id: createNote
params:
text: "Order %state:node.ask_order.text%, reason: %state:node.ask_reason.text%"
customName: "Order bot"
on_complete: handoff
on_failure: handoff
Keep the note ID for a later update
open_ticket_note:
type: func
func_type: chat
func_id: createNote
params:
text: "Ticket opened, waiting for the customer's documents"
on_complete: remember_note_id
on_failure: ask_documents
remember_note_id:
type: func
func_type: chat
func_id: updateCrmData
params:
data:
ticketNoteId: "%state:node.open_ticket_note._id%"
on_complete: ask_documents
tip
An injection token that resolves to empty text fails the node, because a bot note needs at least one character. Add on_failure so the flow does not stop on an empty answer.